/**
 *
 */
package com.btkjgc.utils;

import org.springframework.context.ApplicationContext;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * @author Maple
 */
public class ApplicationContextUtil implements ServletContextListener
{

	private static WebApplicationContext applicationContext = null;

	public ApplicationContextUtil()
	{
		super();
	}

	public static ApplicationContext getApplicationContext()
	{
		return applicationContext;
	}

	@Override
	public void contextInitialized(ServletContextEvent sce)
	{
		applicationContext = WebApplicationContextUtils
				.getWebApplicationContext(sce.getServletContext());
	}

	@Override
	public void contextDestroyed(ServletContextEvent sce)
	{

	}
}
